//
//  VCOfRegistered.m
//  UIHomeWork01
//
//  Created by tusm on 16/7/16.
//  Copyright © 2016年 tusm. All rights reserved.
//

#import "VCOfRegistered.h"
#import "ViewController.h"
@interface VCOfRegistered ()

@end

@implementation VCOfRegistered

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self createSubview];
}
- (void)createSubview{
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    [self.view addSubview:imageView];
    //开交互
    imageView.userInteractionEnabled = YES;
    
    imageView.image = [UIImage imageNamed:@"welcome_2"];
    
    UIImageView *laGouImagView = [[UIImageView alloc] initWithFrame:CGRectMake(150, 100, 100, 160)];
    laGouImagView.image = [UIImage imageNamed:@"logo_lagou"];
    [imageView addSubview:laGouImagView];
    
    
    UIView *viewOfTextField = [[UIView alloc] initWithFrame:CGRectMake(10, 350, self.view.frame.size.width - 20, 90)];
    //    viewOfTextField.backgroundColor = [UIColor blueColor];
    viewOfTextField.layer.cornerRadius = 20;
    //开启
    viewOfTextField.clipsToBounds = YES;
    
    [imageView addSubview:viewOfTextField];
    
    UIImageView *imgName = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
    imgName.bounds = CGRectMake(0, 0, 30, 30);
    imgName.backgroundColor =[UIColor colorWithRed:0.12 green:0.09 blue:0.07 alpha:1.00];
    imgName.image = [UIImage imageNamed: @"icon_username"];
    [viewOfTextField addSubview:imgName];
    
    UITextField *textOfName = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width-20, 40)];
    textOfName.backgroundColor = [UIColor colorWithRed:0.29 green:0.26 blue:0.25 alpha:1.00];
    [viewOfTextField addSubview:textOfName];
    textOfName.borderStyle = UITextBorderStyleRoundedRect;
    //    textOfName.placeholder =@"请输入用户名";
    textOfName.textColor = [UIColor whiteColor];
    textOfName.leftViewMode = UITextFieldViewModeAlways;
    textOfName.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
    textOfName.leftView = imgName;
    
    UIImageView *imgPassWord = [[UIImageView alloc] initWithFrame:CGRectMake(0, 50, 40, 40)];
    imgPassWord.backgroundColor =[UIColor colorWithRed:0.12 green:0.09 blue:0.07 alpha:1.00];
    imgPassWord.image = [UIImage imageNamed: @"icon_password"];
    [viewOfTextField addSubview:imgPassWord];
    
    UITextField *textOfPassWord = [[UITextField alloc] initWithFrame:CGRectMake(40, 50, self.view.frame.size.width-60, 40)];
    textOfPassWord.backgroundColor = [UIColor colorWithRed:0.29 green:0.26 blue:0.25 alpha:1.00];
    [viewOfTextField addSubview:textOfPassWord];
    textOfPassWord.borderStyle = UITextBorderStyleRoundedRect;
    //    textOfName.placeholder =@"请输入用户名";
    textOfPassWord.textColor = [UIColor whiteColor];
    
    
    UIButton *wButton = [UIButton buttonWithType:UIButtonTypeSystem];
    wButton.frame = CGRectMake(self.view.frame.size.width -120 ,460, 80, 30);
    [wButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    [wButton addTarget:self action:@selector(handleForgot) forControlEvents:UIControlEventTouchUpInside];
    [wButton setTitle:@"忘记密码" forState:UIControlStateNormal];
    [imageView addSubview:wButton];
    
    UIButton *LoginButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    LoginButton.frame = CGRectMake(20, 500, self.view.frame.size.width-40, 40);
    LoginButton.backgroundColor = [UIColor colorWithRed:0.00 green:0.67 blue:0.53 alpha:1.00];
    [LoginButton setTitle:@"注册" forState:UIControlStateNormal];
//    [LoginButton addTarget:self action:@selector(handleButton) forControlEvents:UIControlEventTouchUpInside];
    [LoginButton.layer setCornerRadius:8];
    [imageView addSubview:LoginButton];
    [LoginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    
    
    
    
    
    UIButton *xButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    xButton.frame = CGRectMake(20, 570, self.view.frame.size.width-40, 40);
    [xButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [xButton setTitle:@"返回登录" forState:UIControlStateNormal];
    [xButton addTarget:self action:@selector(handlBackToLogin) forControlEvents:UIControlEventTouchUpInside];
    xButton.titleLabel.font = [UIFont systemFontOfSize:20];
    [xButton setTitleColor:[UIColor colorWithRed:0.00 green:0.67 blue:0.53 alpha:1.00] forState:UIControlStateNormal];
    [xButton.layer setMasksToBounds:YES];
    
    [xButton.layer setCornerRadius:10.0]; //设置矩形四个圆角半径
    
    [xButton.layer setBorderWidth:1.0]; //边框宽度
    
    xButton.layer.borderColor=[UIColor colorWithRed:0.00 green:0.67 blue:0.53 alpha:1.00].CGColor;
    
    [imageView addSubview:xButton];
    

    
}
- (void)handlBackToLogin{
    ViewController *vc = [[ViewController alloc] init];
    [self presentViewController:vc animated:NO completion:^{
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
